package com.nbcio.modules.estar.payroll.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.nbcio.modules.estar.payroll.entity.ErpPayrollB;
import com.nbcio.modules.estar.payroll.mapper.ErpPayrollBMapper;
import com.nbcio.modules.estar.payroll.mapper.ErpPayrollMapper;
import com.nbcio.modules.estar.payroll.service.IErpPayrollBService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: 工资明细单子表
 * @Author: nbacheng
 * @Date:   2024-04-28
 * @Version: V1.0
 */
@Service
public class ErpPayrollBServiceImpl extends ServiceImpl<ErpPayrollBMapper, ErpPayrollB> implements IErpPayrollBService {

	@Autowired
	private ErpPayrollBMapper erpPayrollBMapper;

	@Override
	public List<ErpPayrollB> selectByMainId(String mainId) {
		return erpPayrollBMapper.selectByMainId(mainId);
	}

	@Override
	public JSONArray queryProcompletion(JSONObject obj) {
		Map<String, Object> map=JSONObject.toJavaObject(obj,Map.class);
		List<ErpPayrollB> res=erpPayrollBMapper.queryProcompletion(map);

		return (res==null || res.size()==0)?null:JSONArray.parseArray(JSON.toJSONString(res));
	}
}
